﻿#region

using System;
using System.Windows;
using Radovici.SharedLibrary;

#endregion

namespace Radovici.Ctrls.Desktop
{
    public class MenuItemModel : Notifiable
    {
        #region Private fields

        private readonly string _description;
        private readonly DesktopModel _desktop;
        private readonly string _icon;
        private readonly Func<UIElement> _loadView;
        private readonly string _title;

        #endregion

        public MenuItemModel(DesktopModel desktop, string title, string icon, string description,
                             Func<UIElement> loadView)
        {
            _desktop = desktop;
            _title = title;
            _icon = icon;
            _description = description;
            _loadView = loadView;
        }

        public DesktopModel Desktop
        {
            get { return _desktop; }
        }

        public string Title
        {
            get { return _title; }
        }

        public string Icon
        {
            get { return _icon; }
        }

        public string Description
        {
            get { return _description; }
        }

        internal UIElement LoadView()
        {
            return _loadView();
        }

        public WidgetModel CreateWidgetModel()
        {
            return new WidgetModel(this);
        }
    }
}